package cn.enilu.flash.bean.entity.house;

import cn.enilu.flash.bean.entity.BaseEntity;
import lombok.Data;
import org.hibernate.annotations.Table;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.validation.constraints.NotNull;

/**
 * @Description
 * @Author Spark
 * @Date Created in (2019/10/29 16:35)
 * @Version v1.0
 * @Modify
 **/
@Entity(name="building_info")
@Table(appliesTo = "building_info",comment = "大楼")
@Data
@EntityListeners(AuditingEntityListener.class)
public class BuildingInfo extends BaseEntity {
    @Column(name = "community_id", columnDefinition = "BIGINT COMMENT '社区ID'")
    @NotNull(message = "社区未关联")
    private Long communityId;

    @Column(name = "name", columnDefinition = "VARCHAR(64) COMMENT '名称'")
    @NotNull(message = "名称不能为空")
    private String name;

    @Column(name = "code", columnDefinition = "VARCHAR(64) COMMENT '编号'")
    @NotNull(message = "编号不能为空")
    private String code;

    @Column(name = "total_floor", columnDefinition = "INT COMMENT '总层数'")
    @NotNull(message = "总层数不能为空")
    private Integer totalFloor;

    @Column(name = "height", columnDefinition = "DOUBLE COMMENT '高度(米)'")
    @NotNull(message = "高度不能为空")
    private Double height;

    @Column(name = "type", columnDefinition = "INT COMMENT '商住类型'")
    @NotNull(message = "高度不能为空")
    private Integer type;

    @Column(name = "direction", columnDefinition = "VARCHAR(64) COMMENT '朝向'")
    @NotNull(message = "朝向不能为空")
    private String direction;

    @Column(name = "total_area", columnDefinition = "DOUBLE(8,2) COMMENT '总面积(平米)'")
    @NotNull(message = "总面积不能为空")
    private Double totalArea;

    @Column(name = "ladder", columnDefinition = "VARCHAR(64) COMMENT '梯户'")
    private String ladder;

    @Column(name = "has_file", columnDefinition = "INT COMMENT '是否有影像文件'")
    private int hasFile = 0;
}
